/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 *
 * @author sunwei
 */
@Entity (name= "MrpToQuantity")
public class MrpToQuantityEntity extends DataObjectEntity implements Serializable  {
    @ManyToOne
    private RawMaterialRequirementWeeklyEntity mrp;
    private long quantity;
    int type; // 0 for failed mrpAtp , 1 for confirmed updated mrpAtp
    
    @ManyToOne
    private BackorderEntity backOrder1;
    
    @ManyToOne
    private BackorderEntity backOrder2;
    
    @ManyToOne
    private BackorderEntity backOrder3;
    
    
    public MrpToQuantityEntity(){
        super();
    }
    public MrpToQuantityEntity(RawMaterialRequirementWeeklyEntity mrp, long quantity){
        this.mrp = mrp;
        this.quantity = quantity;
    }

    public RawMaterialRequirementWeeklyEntity getMrp(){
        return mrp;
    }
    
    public void setBackOrder3(BackorderEntity backOrder){
        backOrder3 = backOrder;
    }
    
    public BackorderEntity getBackOrder3(){
        return backOrder3;
    }
    
    public void setBackorder1(BackorderEntity backOrder){
        backOrder1= backOrder;
    }
    
    public BackorderEntity getBackOrder1(){
        return backOrder1;
    }
    
    public void setBackorder2(BackorderEntity backOrder){
        backOrder2= backOrder;
    }
    
    public BackorderEntity getBackOrder2(){
        return backOrder2;
    }

    public void setMrp(RawMaterialRequirementWeeklyEntity mrp){
        this.mrp = mrp;
    }
    
    public long getQuantity(){
        return quantity;
    }
    
    public void setQuantity(long quantity){
        this.quantity = quantity;
    }
    

    @Override
    public String childToString() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
